package com.gopay.common.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * User4Amount的复合主键
 * 
 * @User4AmountPK.java
 * @author 曹永峰
 */
@Embeddable
public class User4AmountPK extends BaseEntity {

    private static final long serialVersionUID = -6426210638362796374L;

    private String acctId;

    private Date stlmDate;

    public User4AmountPK() {

    }

    public User4AmountPK(String acctId, Date stlmDate) {
        super();
        this.acctId = acctId;
        this.stlmDate = stlmDate;
    }

    @Column(name = "ACCT_ID", nullable = false, length = 20)
    public String getAcctId() {
        return acctId;
    }

    public void setAcctId(String acctId) {
        this.acctId = acctId;
    }

    @Column(name = "STLM_DATE", nullable = false)
    public Date getStlmDate() {
        return stlmDate;
    }

    public void setStlmDate(Date stlmDate) {
        this.stlmDate = stlmDate;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((acctId == null) ? 0 : acctId.hashCode());
        result = prime * result + ((stlmDate == null) ? 0 : stlmDate.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        User4AmountPK other = (User4AmountPK) obj;
        if (acctId == null) {
            if (other.acctId != null) {
                return false;
            }
        } else if (!acctId.equals(other.acctId)) {
            return false;
        }
        if (stlmDate == null) {
            if (other.stlmDate != null) {
                return false;
            }
        } else if (!stlmDate.equals(other.stlmDate)) {
            return false;
        }
        return true;
    }

}
